package com.zxkj.commonpatrol.net;


import com.zxkj.commonpatrol.model.entity.SubAlarmLogHistory;
import com.zxkj.commonpatrol.model.entity.SubAlarmLogHistorys;
import com.zxkj.commonpatrol.model.response.AlarmIdBean;
import com.zxkj.commonpatrol.model.response.DevEvtPatrolInfoResponse;
import com.zxkj.commonpatrol.model.response.DevEvtQuestPatrolHistoryResponse;
import com.zxkj.commonpatrol.model.response.DevTypeExtendInfo;
import com.zxkj.commonpatrol.model.response.DeviceType;
import com.zxkj.commonpatrol.model.response.InspectionDetailResponse;
import com.zxkj.commonpatrol.model.response.LogBean;
import com.zxkj.commonpatrol.model.response.MediaInfoResponse;
import com.zxkj.commonpatrol.model.response.PointCategoryResponse;
import com.zxkj.commonpatrol.model.response.PointInfoResponse;
import com.zxkj.commonpatrol.model.response.PointInspectDeviceResponse;
import com.zxkj.commonpatrol.model.response.PointInspectEvent;
import com.zxkj.commonpatrol.model.response.PointPatrolDetailResponse;
import com.zxkj.commonpatrol.model.response.ProjectDetailResponse;
import com.zxkj.commonpatrol.model.response.Questions;
import com.zxkj.commonpatrol.model.response.RouteCustomInfoResponse;
import com.zxkj.commonpatrol.model.response.RouteSystemResponse;
import com.zxkj.commonpatrol.model.response.SearchProjectResponse;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HeaderMap;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Streaming;

public interface ETFAPi {

    //分类数据
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/SearchProjects")
    Observable<SearchProjectResponse> getSearchProjects(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //获取线路类别
    @GET("/api/RouteSystems ")
    Observable<RouteSystemResponse> getRouteSystems(@HeaderMap Map<String, Object> headers);

    //获取线路详情
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/GetProjectDetail")
    Observable<ProjectDetailResponse> GetProjectDetail(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //查看滅火器
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Routes/GetRouteCustomInfo")
    Observable<List<RouteCustomInfoResponse>> GetRouteCustomInfo(@HeaderMap Map<String, Object> headers, @Body RequestBody body);
    //保存滅火器
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Routes//SetRouteCustomInfo")
    Observable<ResponseBody> SaveRouteCustomInfo(@HeaderMap Map<String, Object> headers, @Body RequestBody body);
    //获取路线下面的巡查点列表
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Routes/GetInspectRouteInfo")
    Observable<InspectionDetailResponse> getCheckPointList(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //获取新增巡查点profile的种类
    //获取线路类别
    @GET("/api/PointCategorys/{RouteInspectNo}")
    Observable<List<PointCategoryResponse>> getPointCategorys (@HeaderMap Map<String, Object> headers,@Path("RouteInspectNo") String RouteInspectNo);

    // //获取新增巡查点profile的详情

    @GET("/api/CheckPoints/{PointNo}")
    Observable<PointInfoResponse> getBookCheckPoints(@HeaderMap Map<String, Object> headers, @Path("PointNo") String PointNo);

  //保存巡查点profile

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST(" /api/CheckPoints/AddPoint")
    Observable<ResponseBody> SaveCheckPoint(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //获取GetPointPatrolDetail
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/CheckPoints/GetPointPatrolDetail")
    Observable<PointPatrolDetailResponse> GetPointPatrolDetail(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //GetPointInspectDeviceInfo
    @Headers({"Content-Type: application/json","Accept: application/json"})

    @POST("/api/PointDevices/GetPointInspectDeviceInfo")
    Observable<PointInspectDeviceResponse> GetPointInspectDeviceInfo(@HeaderMap Map<String, Object> headers, @Body RequestBody body);
    //获取设备类型(DeviceType)
    @GET("/api/DeviceTypes/{PointNo}")
    Observable<List<DeviceType>> getDeviceType(@HeaderMap Map<String, Object> headers, @Path("PointNo") String PointNo);

    //获取单个设备类型的自定义信息和问题集信息

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/DeviceTypes/GetDevTypeExtendInfo")
    Observable<DevTypeExtendInfo> GetDevTypeExtendInfo(@HeaderMap Map<String, Object> headers, @Body RequestBody body);


    //获取巡检点Event的信息
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/CheckPoints/GetPointInspectEventInfo")
    Observable<PointInspectEvent> GetPointInspectEventInfo(@HeaderMap Map<String, Object> headers, @Body RequestBody body);
    ///api/CheckPoints/AddPointDevice 新增巡检点的Device
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("api/PointDevices/AddPointDevice")
    Observable<ResponseBody> AddPointDevice(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    ///api/CheckPoints/GetEventQuests
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/CheckPoints/GetEventQuests")
    Observable<List<Questions>> GetEventQuests(@HeaderMap Map<String, Object> headers, @Body RequestBody body);
    //
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/CheckPoints/AddPointEvent")
    Observable<ResponseBody> SaveEvent(@HeaderMap Map<String, Object> headers, @Body RequestBody body);


    //获取巡检计划巡检点指定设备的巡检信息
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/DevicePatrols/GetDevEvtPatrolInfo")
    Observable<DevEvtPatrolInfoResponse> getDevPatrolInfo(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //获取巡检计划巡检点设备问题的巡检历史信息
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/DevicePatrols/GetDevEvtQuestPatrolHisoty")
    Observable<DevEvtQuestPatrolHistoryResponse> getDevQuestPatrolHisoty(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //修复异常
    @GET("/api/Logs/FixException/{LogId}")
    Observable<ResponseBody> getFixException(@HeaderMap Map<String, Object> headers, @Path("LogId")String logId);

    //上传巡检记录
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/UploadLog")
    Observable<String> UploadLog(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //上传报警记录
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/UploadAlarmLog")
    Observable<String> UploadAlarmLog(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //获取问题对应的媒体数据信息
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/GetAlarmLogMedioInfo")
    Observable<List<MediaInfoResponse>> getAlarmLogMedioInfo(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //下载语音数据
    @Streaming
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/DownloadAlarmLogVoice")
    Observable<ResponseBody> downloadAlarmLogVoice(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //下载图片数据
    @Streaming
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/DownloadAlarmLogPhoto")
    Observable<ResponseBody> downloadAlarmLogPhoto(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //下载视频数据
    @Streaming
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/DownloadAlarmLogVedio")
    Observable<ResponseBody> downloadAlarmLogVedio(@HeaderMap Map<String, Object> headers, @Body RequestBody body);


    //测试下载视频数据
    @Streaming
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs2/DownloadAlarmLogPhoto")
    Observable<ResponseBody> Text();



    //上传未修复巡检记录
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/UploadSubAlarmLog")
    Observable<String> UpUnloadLog(@HeaderMap Map<String, Object> headers, @Body RequestBody body);



    //获取子问题历史列表
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logs/GetSubAlarmLogHistory ")
    Observable<SubAlarmLogHistorys> getSubDevQuestPatrolHisoty(@HeaderMap Map<String, Object> headers, @Body RequestBody body);

    //修复子异常
    @GET("/api/Logs/FixSubAlarmLog/{id}")
    Observable<ResponseBody> getFixSubException(@HeaderMap Map<String, Object> headers, @Path("id")String logId);

}
